package de.hska.pwmanager.controller;

import java.util.List;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import de.hska.pwmanager.persistence.model.User;


public interface IUserController {

	@RequestMapping(value = "prototype", method = RequestMethod.GET)
	public @ResponseBody
	abstract User prototype(@RequestParam(value = "id") int param);

	@RequestMapping(value = "read", method = RequestMethod.GET)
	public @ResponseBody
	abstract List<User> readAll();

	@RequestMapping(value = "create", method = RequestMethod.POST)
	public abstract @ResponseBody void createOrUpdate(@RequestBody User toCreateOrUpdate);

	@RequestMapping(value = "delete/{id}", method = RequestMethod.GET)
	public abstract @ResponseBody void delete(@PathVariable(value = "id") Long pkToDelete);

	@RequestMapping(value = "validate", method = RequestMethod.POST)
	public abstract @ResponseBody void validate(@RequestBody User toValidate);

	@RequestMapping(value = "user/{id}", method = RequestMethod.GET)
	public @ResponseBody
	abstract User readByPK(@PathVariable(value = "id") Long pk);

}